package com.pan.controller;


import com.pan.entity.OperationGoodsPriceHistory;
import com.pan.entity.Result;
import com.pan.service.GoodsPriceHistoryService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/goodsPriceHistory")
public class GoodsPriceHistoryController {

    @Resource
    private GoodsPriceHistoryService goodsPriceHistoryService;

    @ResponseBody
    @GetMapping("/select/{selectName}/{selectValue}")
    public Result<List<OperationGoodsPriceHistory>> select(@CookieValue("adminTicket") String adminTicket,
                                                           @PathVariable("selectName") String selectName,
                                                           @PathVariable("selectValue") Object selectValue){
        Result<List<OperationGoodsPriceHistory>> result =
                goodsPriceHistoryService.selectByAdminIdOrGoodsIdOrUpdateDate(adminTicket, selectValue, selectName);
        return result;

    }

}
